<template>
  <div class="nr">
    <div style="width:100%;height:1px;"></div>

    <div class="item" >
        <div style="width:100%;height:1px;"></div>
        <div class="t1">你的专属邀请码</div>
        <div  class="t2">{{yaoqingma}}</div>
        <div  class="t3" @click="copy">复制</div>
        <div  class="t4">这是你的专属邀请码，发送给好友，并且好友通过你的邀请下载韩乐讯，你可获得收益奖励。</div>
    </div>


    <div class="top" id="openApp" @click="open">
      <div class="left">
        <img style="margin-right:4px;" src="../assets/fenxiang/logo.png" alt />
        <div class="t1" style="margin-top:0rem;">韩乐讯</div>
      </div>
      <div class="right">下载APP</div>

      <!-- <div id="mod_pop" v-if="isweixin==true" class="right">请在其他浏览器中打开</div> -->
    </div>


    <input type="text" v-model="yaoqingma" id='biao1'  >
  </div>
</template>

<script>
export default {
    data() {
        return {
            // key: value
            // isweixin: true,
        
            yaoqingma:'12554'
        };
    },
    mounted() {
        this.yaoqingma=this.$route.query.yaoqingma
        
        // var isweixin = this.isWeixin();
        // this.isweixin = isweixin;
    },

    methods: {
        isWeixin() {
            var ua = navigator.userAgent.toLowerCase(); //获取判断用的对象
            if (ua.match(/MicroMessenger/i) == "micromessenger") {
                return true; //微信打开
            } else {
                return false; //不是微信打开
            }
        },
         open(e) {
            // console.log("1111");
            // if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
            //   //ios判断
            //   window.location.href = "https://www.hlx.open"; //通过app打开协议来打开app
            //   window.setTimeout(function() {
            //     window.location.href = "https://itunes.apple.com/cn/app/id477927812"; //没有弹框打开app则打开app下载地址
            //   }, 20);
            // } else if (/(Android)/i.test(navigator.userAgent)) {
            //   //Android判断
            //   var state = null;
            //   try {
            //     state = window.open("https://www.hlx.open");
            //   } catch (e) {}
            //   if (state) {
            //     window.close();
            //   } else {
            //     window.location.href =
            //       "https://downpack.baidu.com/baidutieba_AndroidPhone_v9.0.8.0(9.0.8.0)_1019960r.apk";
            //   }
            // }

            window.location.href ="https://downpack.baidu.com/baidutieba_AndroidPhone_v9.0.8.0(9.0.8.0)_1019960r.apk";
        },
        copy(){
            var Url2=document.getElementById("biao1");
            console.log(Url2)
            Url2.select(); // 选择对象
            document.execCommand("Copy"); // 执行浏览器复制命令

            this.$message({
                showClose: true,
                message: '复制成功',
                type: "success"
            });
        },
        getall(){
            
        }
    }
};
</script>

<style scoped>
#biao1{
    position: absolute;
    z-index: -1;

}
.t1{
    margin-top:0.62rem;
    font-size:0.28rem;
    line-height:0.4rem;
    color:rgba(51,51,51,1);
    text-align: center;
}
.t2{
    font-size:0.6rem;
    margin-top:0.08rem;
    line-height:0.84rem;
    color:#FC5A8E;
    text-align: center;
}
.t3{
    width:1.8rem;
    height:0.64rem;
    background:#FC5A8E;
    opacity:1;
    border-radius:4px;
    margin: 0.2rem auto 0;
    text-align: center;
    font-size:0.32rem;

    line-height:0.64rem;
    color:rgba(255,255,255,1);
}
.t4{
    margin-top: 1.2rem;
    font-size:0.28rem;

    line-height:0.4rem;
    color:rgba(172,172,172,1);
    padding: 0 0.4rem;
}
.item {
    position: relative;
    z-index: 100;
    width:6.16rem;
    height:6rem;
    background-image: url(../assets/fenxiang/bg.png);
    margin :1.14rem auto 0;
    background-size: 100% 100%;
}
.nr {
  width: 100%;
  height: 100vh;
  background: rgba(247, 247, 247, 1);
  /* position: relative; */
}
.top {
  width: 7.5rem;
  height: 1.06rem;
  background: rgba(255, 255, 255, 1);
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.28rem;
  box-sizing: border-box;
  position: absolute;
  bottom:0;
  left:0;

}
.left {
  display: flex;
  align-items: center;
}
.t11 {
  font-size: 0.32rem;

  font-weight: 400;
  line-height: 0.54rem;
}
.right {
  font-size: 0.28rem;
  line-height: 0.4rem;
  color: #FC5A8E;
}
.right_right {
  width: 1.12rem;
  height: 0.56rem;
  border: 1px solid rgba(252, 90, 142, 1);
  opacity: 1;
  font-size: 0.2rem;
  color: rgba(252, 90, 142, 1);
  line-height: 0.56rem;
  text-align: center;
  border-radius: 0.28rem;
}
</style>